package com.duoduo.adapter;

import com.duoduo.db.DBHelper;
import com.duoduo.sanguoshanews.R;

import android.content.Context;
import android.database.Cursor;
import android.support.v4.widget.CursorAdapter;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

public class SanGuoShaAdapter extends CursorAdapter {

	public SanGuoShaAdapter(Context context, Cursor c) {
		super(context, c);
	}

	public void bindView(View view, Context context, Cursor cursor) {
		TextView news_view = (TextView) view.findViewById(R.id.news_item);
		news_view.setText(cursor.getString(cursor
				.getColumnIndex(DBHelper.NEWS_COLUMN_CONTENT)));

	}

	public View newView(Context context, Cursor cursor, ViewGroup parent) {
		LayoutInflater inflater = LayoutInflater.from(parent.getContext());
		View view = inflater.inflate(R.layout.news_list_item, parent, false);
		return view;
	}

}
